package com.ruoyi.web.controller.biz;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.system.domain.biz.BmAmountDetailRecord;
import com.ruoyi.system.domain.biz.BmMemberReport;
import com.ruoyi.system.domain.biz.IndexView;
import com.ruoyi.system.service.biz.IBmAmountDetailRecordService;
import com.ruoyi.system.service.biz.IBmMemberReportService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*;

import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.List;

/**
 * @BelongsProject: RuoYi
 * @BelongsPackage: com.ruoyi.web.controller.biz
 * @Author: xiangzhipeng
 * @CreateTime: 2022-11-28  13:55
 * @Description: TODO
 * @Version: 1.0
 */
@Controller
@RequestMapping("/biz/index")
public class indexController  extends BaseController {

    @Autowired
    private IBmMemberReportService bmMemberReportService;

    @RequiresPermissions("biz:report:list")
    @PostMapping("/show")
    @ResponseBody
    public List<BmMemberReport> list(BmMemberReport bmMemberReport)
    {
        List<BmMemberReport> list = bmMemberReportService.selectBmMemberReportList(bmMemberReport);
        if(!CollectionUtils.isEmpty(list) && list.size()>15){
            return list.subList(0,15);
        }else {
            return list;
        }
    }
}
